package org.jiuling.kuaidi100.model;

import java.util.List;

/**
 * 实时快递查询模型
 * @author 紫灵
 * @date 2024年02月29日 00时31分42秒
 */
public class RealTimeExpressCheckModel {

    /** 消息体，请忽略 */
    private String message;
    /** 单号 */
    private String nu;
    /** 是否签收标记，0未签收，1已签收，请忽略，明细状态请参考state字段 */
    private String  ischeck;
    /** 快递单明细状态标记，暂未实现，请忽略 */
    private String  condition;
    /** 快递公司编码,一律用小写字母 */
    private String  com;
    /** 通讯状态，请忽略 */
    private String  status;
    /** 快递单当前状态，默认为0在途，1揽收，2疑难，3签收，4退签，5派件，8清关，14拒签等10个基础物流状态，如需要返回高级物流状态，请参考 resultv2 传值 */
    private String  state;
    /** 最新查询结果，数组，包含多项，全量，倒序（即时间最新的在最前），每项都是对象，对象包含字段请展开 */
    private List<DataModel> dataList;

    public String getMessage() {
        return message;
    }

    public String getNu() {
        return nu;
    }

    public String getIscheck() {
        return ischeck;
    }

    public String getCondition() {
        return condition;
    }

    public String getCom() {
        return com;
    }

    public String getStatus() {
        return status;
    }

    public String getState() {
        return state;
    }

    public List<DataModel> getDataList() {
        return dataList;
    }

    /**
     * 建造者
     * @return 建造者
     */
    public static Builder builder(){
        return new Builder();
    }

    /**
     * 建造者
     */
    public static class Builder{

        /** 实时快递查询模型 */
        private final RealTimeExpressCheckModel realTimeExpressCheckModel;

        public Builder() {
            this.realTimeExpressCheckModel = new RealTimeExpressCheckModel();
        }

        public Builder addMessage(String message) {
            realTimeExpressCheckModel.message = message;
            return this;
        }

        public Builder addNu(String nu) {
            realTimeExpressCheckModel.nu = nu;
            return this;
        }

        public Builder addIscheck(String ischeck) {
            realTimeExpressCheckModel.ischeck = ischeck;
            return this;
        }

        public Builder addCondition(String condition) {
            realTimeExpressCheckModel.condition = condition;
            return this;
        }

        public Builder addCom(String com) {
            realTimeExpressCheckModel.com = com;
            return this;
        }

        public Builder addStatus(String status) {
            realTimeExpressCheckModel.status = status;
            return this;
        }

        public Builder addState(String state) {
            realTimeExpressCheckModel.state = state;
            return this;
        }

        public Builder addDataList(List<DataModel> dataList) {
            realTimeExpressCheckModel.dataList = dataList;
            return this;
        }

        /**
         * 构建
         * @return 实时快递查询模型
         */
        public RealTimeExpressCheckModel build(){
            return realTimeExpressCheckModel;
        }


    }

    /**
     * 数据
     */
    public static class DataModel{

        /** 时间，原始格式 */
        private String time;
        /** 格式化后时间 */
        private String ftime;
        /** 内容 */
        private String context;

        /** 本数据元对应的物流状态名称或者高级状态名称，实时查询接口中提交resultv2=1或者resultv2=4标记后才会出现 */
        private String status;
        /** 本数据元对应的高级物流状态值，实时查询接口中提交resultv2=4标记后才会出现 */
        private String statusCode;
        /** 本数据元对应的行政区域的编码，实时查询接口中提交resultv2=1或者resultv2=4标记后才会出现 */
        private String areaCode;
        /** 本数据元对应的行政区域的名称，实时查询接口中提交resultv2=1或者resultv2=4标记后才会出现 */
        private String areaName;
        /** 本数据元对应的行政区域经纬度，实时查询接口中提交resultv2=4标记后才会出现 */
        private String areaCenter;
        /** 本数据元对应的快件当前地点，实时查询接口中提交resultv2=4标记后才会出现 */
        private String location;
        /** 本数据元对应的行政区域拼音，实时查询接口中提交resultv2=4标记后才会出现 */
        private String areaPinYin;

        public String getTime() {
            return time;
        }

        public String getFtime() {
            return ftime;
        }

        public String getContext() {
            return context;
        }

        public String getStatus() {
            return status;
        }

        public String getStatusCode() {
            return statusCode;
        }

        public String getAreaCode() {
            return areaCode;
        }

        public String getAreaName() {
            return areaName;
        }

        public String getAreaCenter() {
            return areaCenter;
        }

        public String getLocation() {
            return location;
        }

        public String getAreaPinYin() {
            return areaPinYin;
        }

        public static Builder builder(){
            return new Builder();
        }

        public static class Builder{
            /** 数据 */
            private final DataModel data;

            public Builder() {
                this.data = new DataModel();
            }

            public Builder addTime(String time) {
                data.time = time;
                return this;
            }

            public Builder addFtime(String ftime) {
                data.ftime = ftime;
                return this;
            }

            public Builder addContext(String context) {
                data.context = context;
                return this;
            }

            public Builder addStatus(String status) {
                data.status = status;
                return this;
            }

            public Builder addStatusCode(String statusCode) {
                data.statusCode = statusCode;
                return this;
            }

            public Builder addAreaCode(String areaCode) {
                data.areaCode = areaCode;
                return this;
            }

            public Builder addAreaName(String areaName) {
                data.areaName = areaName;
                return this;
            }

            public Builder addAreaCenter(String areaCenter) {
                data.areaCenter = areaCenter;
                return this;
            }

            public Builder addLocation(String location) {
                data.location = location;
                return this;
            }

            public Builder addAreaPinYin(String areaPinYin) {
                data.areaPinYin = areaPinYin;
                return this;
            }

            /**
             * 构建
             * @return 构建数据
             */
            public DataModel build(){
                return data;
            }
        }
    }
    
}
